#include <iostream>
#include <string>
#include <ctemplate/template.h>

using namespace std;

int main()
{
    std::string in_html = "./test.html";
    std::string value = "渲染工具";

    // 构建字典
    ctemplate::TemplateDictionary dict("test");
    dict.SetValue("ctemplate_key", value);

    // 构建被渲染的网页对象 DO_NOT_STRIP(不要删除任何符号)
    ctemplate::Template *tpl = ctemplate::Template::GetTemplate(in_html, ctemplate::DO_NOT_STRIP);

    // 添加字典数据到网页中
    std::string out_html;
    tpl->Expand(&out_html, &dict);

    std::cout << out_html << std::endl;

    return 0;
}